﻿<controls:ChildWindow
    x:Class="EyeOpen.TimeAssistant.UI.Silverlight.LoginForm"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    xmlns:busyIndicator="clr-namespace:EyeOpen.TimeAssistant.UI.Silverlight" 
    Title="LoginForm">

    <Grid
        DataContext="{Binding Path=UserViewModel, Source={StaticResource viewModelLocator}}">
        <Grid.RowDefinitions>
            <RowDefinition Height="23"/>
            <RowDefinition Height="23"/>
            <RowDefinition Height="25"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100"/>
            <ColumnDefinition Width="200"/>
        </Grid.ColumnDefinitions>
        <TextBlock
            Text="User"
            Grid.Column="0"
            Grid.Row="0"
        />
        <TextBlock
            Text="Password"
            Grid.Column="0"
            Grid.Row="1"
        />
        <TextBox
            Grid.Column="1"
            Grid.Row="0"
            Text="{Binding User, Mode=TwoWay}"
        />
        <PasswordBox
            Grid.Column="1"
            Grid.Row="1"
            Password="{Binding Password, Mode=TwoWay}"
         />
        <Button
            Content="Cancel"
            Command="{Binding Path=CloseLoginWindowCommand}"
            Margin="2,2,2,0"
            Grid.Row="2"
            Grid.Column="1"
        />
        <Button
            Grid.Row="2"
            Grid.Column="0"
            Margin="2,2,2,0"
            Content="Ok"
            IsEnabled="{Binding OkButtonIsEnabled}"
            Command="{Binding Path=AuthenticateUserCommand}">
        </Button>
        <busyIndicator:BusyIndicator
            Grid.ColumnSpan="2" 
            Grid.RowSpan="3"/>
    </Grid>
</controls:ChildWindow>